package top.mable.rabbitmq.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author taffywen
 * @date 2022/7/24 11:03
 */

//@Configuration
public class PrintRabbitMqConfig {

    @Bean
    public TopicExchange printTopicExchange(){


        return new TopicExchange("rabbitMqExchange",true,false);
    }


    @Bean
    public Queue printQueue(){
        return new Queue("printQueue",true,false,false);
    }

    @Bean
    public Binding  printBinding(){
        return BindingBuilder.bind(printQueue()).to(printTopicExchange()).with("print");
    }
}
